const banners = require("express").Router();
const { Validator, banner } = require("../../../validators");
const BannerController = require("../../../controllers/banner");
// 获取所有轮播图
banners.get("/", BannerController.list);
// 添加轮播图
banners.post("/", Validator(banner.add), BannerController.add);
// 删除轮播图
banners.delete("/:id", Validator(banner.delete), BannerController.delete);
// 修改轮播图
banners.patch("/:id", Validator(banner.update), BannerController.update);

module.exports = banners;
